const proxy = require('koa-proxies');

module.exports = (app) => {
    app.use(proxy('/api', {
        target: 'http://127.0.0.1:9108',
        changeOrigin: true,
        // rewrite: path => path.replace(/^\/api/, ''),
        events: {
            proxyReq (proxyReq, req, res) {
                // proxyReq.setHeader('cookie', 'SESSION=YWE3MM1LTlhYzYtYjZhZTBkMDdlYTFm;');
            }
        }
    }));
};